import pygame
import os

from pygame.locals import *
from coloredsprite import ColoredSprite

class Player(ColoredSprite):  
    def __init__(self):
        ColoredSprite.__init__(self, ("img", "brick.png"))
        
        self.x = pygame.display.get_surface().get_width() / 2 - self.get_width() / 2
        self.y = pygame.display.get_surface().get_height() - self.get_height()
        
    def get_x(self):
        return self.x
        
    def get_y(self):
        return self.y
        
    def get_width(self):
        return self.get_texture().get_width()
        
    def get_height(self):
        return self.get_texture().get_height()
        
    def draw(self, screen):
        screen.blit(self.get_texture(), (self.x, self.y))
        
    def handle_input_event(self, event):
        if event.type == MOUSEMOTION:
            self.x = event.pos[0] - (self.get_width() / 2)